﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="System.Collections.Generic" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	磷石膏堆积坝（每日）
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="dolphincontainer">
	    <div id="dolphinnav">
	        <ul class="top_tab">
                <li><a href="/Record/StackWater/<%=ViewData["id"]%>?date=<%=(DateTime)ViewData["date"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>水位及水质</span></a></li>
                <li><a href="/Record/BackWater/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["date"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>进浆及回水</span></a></li>
                <li><a href="/Record/Settle/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["date"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>沉降及位移</span></a></li>
                <li><a href="/Record/Ardealite/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["date"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>磷石膏堆积坝</span></a></li>
                <li><a href="javascript:return(false);" class="current"><span>截洪沟</span></a></li>
                <li><a href="/Record/PiezometerWell/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["date"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>浸润线观测</span></a></li>
                <li><a href="/Record/PiezometerBase/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["date"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>渗压观测</span></a></li>
                <li><a href="/Record/Drain/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["date"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>导渗系统</span></a></li>
	        </ul>
	    </div>
	</div>

    <%
        string[] positions = new string[] { "", "东", "东南", "南", "西南", "西", "西北", "北", "东北" };
        string ditchDesignPic = (string)ViewData["ditchDesignPic"];
        List<Runoff_Interception_Ditch_Base_Info> ditches = (List<Runoff_Interception_Ditch_Base_Info>)ViewData["ditchs"];
        bool result = (bool)ViewData["success"];
        if(result){ 
     %>
           <div class="tips_area">截洪沟更新成功</div>
        <%
        }
        %>

    <% using (Html.BeginForm())
    {
    %>
        <%= Html.ValidationSummary(true) %>
        <%= Html.Hidden("stack_id", ViewData["stack_id"])%>
        <%= Html.Hidden("ditchNos", ViewData["ditchNos"])%>
        <%= Html.Hidden("factoryId", ViewData["factoryId"]) %>
        <%= Html.Hidden("date", (DateTime)ViewData["date"])%>

    <% 
           DateTime date =  (DateTime)ViewData["date"];
    %>
    
    <table cellpadding="4" cellspacing="0" class="com_from_table" style="width:756px;">
        <tr>
            <th colspan="2">截洪沟（每日 - <%= date.Year%>年<%=date.Month%>月<%=date.Day%>日）</th>
        </tr>

        <tr>
            <td class="lab" style="width:158px;">测量人员：</td>
            <td>
                <%= Html.DropDownList("tester_id", ViewData["users"] as List<SelectListItem>, "请选择", new { style = "width:150px" })%>
            </td>
        </tr>
        <tr>
            <td class="lab">查看截洪沟位置：</td>
            <td>
                <%if (!string.IsNullOrEmpty(ditchDesignPic)){ %><a href="<%=Url.Content((string)ViewData["ditchDesignPic"]) %>" target="_blank">截洪沟设计图</a><%} %>
            </td>
        </tr>
    </table>
    
    
    <%foreach (Runoff_Interception_Ditch_Base_Info ditch in ditches) { %>
        
        <%
            Runoff_Interception_Ditch_daily_info ditchRecord = (Runoff_Interception_Ditch_daily_info)ViewData["dailyDitch" + ditch.ditch_no];
        %>
        
        
        <fieldset class="tf_style2" style="margin-bottom:10px;">

            <p><strong>[<%=(ditch.position.HasValue ? positions[ditch.position.Value] : "")%>] [<%=(ditch.El.HasValue ? ditch.El.Value.ToString() : "")%>]米 高程截洪沟：</strong></p>
        

            <fieldset class="tf_style" style="width:auto;">
                <p>
                    <span style="display:inline-block;width:180px">侧壁或底部是否有裂纹产生：</span>
                    <input type="radio" name="is_Sidewall_Crack<%=ditch.ditch_no %>" value="1" <%if (ditchRecord.is_Sidewall_Crack == 1){ %>checked="checked"<%} %> onclick='switchComment("is_Sidewall_Crack<%=ditch.ditch_no %>", "Sidewall_Crack_description<%=ditch.ditch_no %>");' />有<span style="margin-left:10px">&nbsp;</span><input type="radio" name="is_Sidewall_Crack<%=ditch.ditch_no %>" value="0" <%if (ditchRecord.is_Sidewall_Crack != 1){ %>checked="checked"<%} %> onclick='switchComment("is_Sidewall_Crack<%=ditch.ditch_no %>", "Sidewall_Crack_description<%=ditch.ditch_no %>");' />无
                </p>
                <textarea rows="5" cols="80" id="Sidewall_Crack_description<%=ditch.ditch_no %>" name="Sidewall_Crack_description<%=ditch.ditch_no %>"><%= ditchRecord.Sidewall_Crack_description%></textarea>
                <p></p>
                <p>
                    <span style="display:inline-block;width:180px">截洪沟内是否发生淤堵：</span>
                    <input type="radio" name="is_Clogging<%=ditch.ditch_no %>" value="1" <%if (ditchRecord.is_Clogging == 1){ %>checked="checked"<%} %> onclick='switchComment("is_Clogging<%=ditch.ditch_no %>", "Clogging_description<%=ditch.ditch_no %>");' />有<span style="margin-left:10px">&nbsp;</span><input type="radio" name="is_Clogging<%=ditch.ditch_no %>" value="0" <%if (ditchRecord.is_Clogging != 1){ %>checked="checked"<%} %> onclick='switchComment("is_Clogging<%=ditch.ditch_no %>", "Clogging_description<%=ditch.ditch_no %>");' />无
                </p>
                <textarea rows="5" cols="80" id="Clogging_description<%=ditch.ditch_no %>" name="Clogging_description<%=ditch.ditch_no %>"><%= ditchRecord.Clogging_description%></textarea>
                <p></p>
                <p>
                    <span style="display:inline-block;width:180px">外侧边坡是否有失稳迹象：</span>
                    <input type="radio" name="is_Instability<%=ditch.ditch_no %>" value="1" <%if (ditchRecord.is_Instability == 1){ %>checked="checked"<%} %> onclick='switchComment("is_Instability<%=ditch.ditch_no %>", "Instability_description<%=ditch.ditch_no %>");' />有<span style="margin-left:10px">&nbsp;</span><input type="radio" name="is_Instability<%=ditch.ditch_no %>" value="0" <%if (ditchRecord.is_Instability != 1){ %>checked="checked"<%} %> onclick='switchComment("is_Instability<%=ditch.ditch_no %>", "Instability_description<%=ditch.ditch_no %>");' />无
                </p>
                <textarea rows="5" cols="80" id="Instability_description<%=ditch.ditch_no %>" name="Instability_description<%=ditch.ditch_no %>"><%= ditchRecord.Instability_description%></textarea>
                <p></p>
                <p>
                    <span style="display:inline-block;width:180px">内侧道路是否出现裂纹：</span>
                    <input type="radio" name="is_Innerwall_Crack<%=ditch.ditch_no %>" value="1" <%if (ditchRecord.is_Innerwall_Crack == 1){ %>checked="checked"<%} %> onclick='switchComment("is_Innerwall_Crack<%=ditch.ditch_no %>", "Innerwall_Crack_description<%=ditch.ditch_no %>"); ' />有<span style="margin-left:10px">&nbsp;</span><input type="radio" name="is_Innerwall_Crack<%=ditch.ditch_no %>" value="0" <%if (ditchRecord.is_Innerwall_Crack != 1){ %>checked="checked"<%} %> onclick='switchComment("is_Innerwall_Crack<%=ditch.ditch_no %>", "Innerwall_Crack_description<%=ditch.ditch_no %>"); ' />无
                </p>
                <textarea rows="5" cols="80" id="Innerwall_Crack_description<%=ditch.ditch_no %>" name="Innerwall_Crack_description<%=ditch.ditch_no %>"><%= ditchRecord.Innerwall_Crack_description%></textarea>
            </fieldset>

        </fieldset>
        
        <%} %>

    <div class="submit_btn_area" style=" margin-left:152px;">
        <input type="submit" value="提 交" />
    </div>

    <% } %>
    
    <script type="text/javascript">
        function switchComment(optionName, commentId) {
            var value = $("input[name=" + optionName + "]:checked").val();
            if (value == "0") {
                $("#" + commentId).css("display", "none");
            }
            else {
                $("#" + commentId).css("display", "");
            }
        }
        <%foreach (Runoff_Interception_Ditch_Base_Info ditch in ditches) { %>
        
        <%
            Runoff_Interception_Ditch_daily_info ditchRecord = (Runoff_Interception_Ditch_daily_info)ViewData["dailyDitch" + ditch.ditch_no];
        %>
        switchComment("is_Sidewall_Crack<%=ditch.ditch_no %>", "Sidewall_Crack_description<%=ditch.ditch_no %>");
        switchComment("is_Clogging<%=ditch.ditch_no %>", "Clogging_description<%=ditch.ditch_no %>"); 
        switchComment("is_Instability<%=ditch.ditch_no %>", "Instability_description<%=ditch.ditch_no %>");
        switchComment("is_Innerwall_Crack<%=ditch.ditch_no %>", "Innerwall_Crack_description<%=ditch.ditch_no %>"); 
        <%} %>
    </script>  

</asp:Content>
